{temp('admin/head')}
	
</head>
<body class="page-body">
		
		{temp('admin/left')}
			
			{temp('admin/top')}
			
			<!-- Basic Setup -->
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">{$tit}</h3>
					<div class="panel-options">
						
						<a href="#" style="color:red;">
							<i class="fa fa-yelp"></i>
							冻结为禁止用户登录。
							解冻为恢复用户登录权限。
							重置为将用户密码重置为“123456”。
							评价是专家对用户的评价意见。
							经历是用户的学习经历。
						</a>
						
						<a href="{$_url}/admin/?act=recruit&met=user{$gnpd}">
							<i class="fa-rotate-right"></i>
							刷新
						</a>
						
					</div>
				</div>
				<div class="panel-body">
					
					<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$("#example").dataTable({
							"oLanguage": {
								"sUrl":"{$adstyle}/js/datatables/js/zn.txt"
							},
							aLengthMenu: [
								[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]
							]
						});
					});
					</script>
					
					<div data-pattern="priority-columns" data-add-display-all-btn="false" data-add-focus-btn="false">
					
					<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th>ID</th>
								<th>手机</th>
								<th>邮箱</th>
								<th>注册类型</th>
								<th>上次登录时间</th>
								<th>注册时间</th>
								<th>等级</th>
								<th>操作</th>
							</tr>
						</thead>
					
						<tbody class="middle-align">
							{if(@$rs)}
							{foreach($rs as $k=>$v)}
							<tr>
								<td>{$v['id']}</td>
								<td>{$v['phone']}</td>
								<td>{$v['email']}</td>
								<td>{if($v['type'] == 1)}手机{else}邮箱{/if}</td>
								<td>{code(echo date('Y-m-d H:i:s',$v['dltime']))}</td>
								<td>{code(echo date('Y-m-d H:i:s',$v['time']))}</td>
								<td>
									{if($v['level'] == 0)}{else}<img src="{$adstyle}/images/jifen/jifen_{$v['level']}.png">{/if}
									{if($v['vlevel'] == 1)}<img src="{$adstyle}/images/jifen/lixian.png">{/if}
			  	   	     			{if($v['slevel'] == 1)}<img src="{$adstyle}/images/jifen/zaixian.png">{/if}
			  	   	     		</td>
								<td>
									<button onClick="bianji({$v['id']})" class="btn btn-secondary btn-sm btn-icon icon-left">
										编辑
									</button>
									
									<button onClick="shanchu({$v['id']})" class="btn btn-danger btn-sm btn-icon icon-left">
										删除
									</button>
									
									{if($v['dongjie'] == 1)}
									<button onClick="dongjie({$v['id']},0)" class="btn btn-info btn-sm btn-icon icon-left">
										解冻
									</button>
									{else}
									<button onClick="dongjie({$v['id']},1)" class="btn btn-info btn-sm btn-icon icon-left">
										冻结
									</button>
									{/if}
									
									<button onClick="czpass({$v['id']})" class="btn btn-orange btn-sm btn-icon icon-left">
										重置
									</button>
									
									<button onClick="view({$v['id']})" class="btn btn-pink btn-sm btn-icon icon-left">
										评价
									</button>
									
									<button onClick="pxjl({$v['id']})" class="btn btn-turquoise btn-sm btn-icon icon-left">
										经历
									</button>
									
								</td>
							</tr>
							{/foreach}
							{/if}
						</tbody>
					</table>
					
					</div>
					
				</div>
			</div>
			
			<script type="text/javascript">
				function view(id){//专家意见
					window.location.href='{$_url}/admin/?act=recruit&met=view&uid='+id+'{$gnpd}';
				}
				function pxjl(id){//培训经历
					window.location.href='{$_url}/admin/?act=recruit&met=pxjl&uid='+id+'{$gnpd}';
				}
				function bianji(id){//编辑
					window.location.href='{$_url}/admin/?act=recruit&met=user_update&id='+id+'{$gnpd}';
				}
				function shanchu(id){//删除
					$.post('{$_url}/admin/?act=recruit&met=user_delete{$gnpd}',{id:id},function(data){
						showAjaxModal(data);
						if(data == '删除成功'){
							$("#queding").attr("onclick","tiao()");
						}
					});
				}
				function dongjie(id,dongjie){//冻结
					$.post('{$_url}/admin/?act=recruit&met=user_type{$gnpd}',{id:id,dongjie:dongjie},function(data){
						if(data == 'ok'){
							tiao();
						}else{
							showAjaxModal(data);
						}
					});
				}
				function czpass(id){//重置密码
					$.post('{$_url}/admin/?act=recruit&met=user_pass{$gnpd}',{id:id},function(data){
						showAjaxModal(data);
					});
				}
				function showAjaxModal(data){//ajax弹窗
					jQuery('#modal-7').modal('show', {backdrop: 'static'});
					jQuery('#modal-7 .modal-body').html(data);
				}
				function tiao(){//创建成功跳转
					window.location.href='{$_url}/admin/?act=recruit&met=user{$gnpd}';
				}
			</script>
			
		{temp('admin/foot')}
	
	<!-- Modal 7 (Ajax Modal)-->
	<div class="modal fade" id="modal-7">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title">删除用户</h4>
				</div>
				<div class="modal-body">
					Content is loading...
				</div>
				<div class="modal-footer">
					<button id="queding" type="button" class="btn btn-info" data-dismiss="modal">确定</button>
				</div>
			</div>
		</div>
	</div>
	
	<!-- Imported styles on this page -->
	<link rel="stylesheet" href="{$adstyle}/js/datatables/dataTables.bootstrap.css">

	<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>
	<script src="{$adstyle}/js/datatables/js/jquery.dataTables.min.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/datatables/dataTables.bootstrap.js"></script>
	<script src="{$adstyle}/js/rwd-table/js/rwd-table.min.js"></script>

	<!-- JavaScripts initializations and stuff -->
	<script src="{$adstyle}/js/xenon-custom.js"></script>

</body>
</html>